package com.flyduck.system.vo.dept.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysDeptEntity;
import com.flyduck.system.vo.dept.SysDeptTreeRespVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysDeptEntityToSysDeptTreeRespVO implements Function<SysDeptEntity, SysDeptTreeRespVO> {

    @Override
    public SysDeptTreeRespVO apply(SysDeptEntity sysDeptEntity) {
        SysDeptTreeRespVO sysDeptTreeRespVO = new SysDeptTreeRespVO();
        BeanUtil.copyProperties(sysDeptEntity,sysDeptTreeRespVO);
        sysDeptTreeRespVO.setId(sysDeptEntity.getId()+"");
        sysDeptTreeRespVO.setSort(sysDeptEntity.getSort()+"");
        sysDeptTreeRespVO.setParentId(sysDeptEntity.getParentId()+"");
        return sysDeptTreeRespVO;
    }
}
